<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	final int PORT = request.getServerPort();
	final String SITE = "http://" + request.getServerName() + (PORT == 80 ? "" : ":" + String.valueOf(PORT)) + request.getContextPath();
	pageContext.setAttribute("SITE", SITE);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Wellcome To Home</title>
</head>
<body>
	<div style="margin-left: auto;margin-right:auto;margin-top: 200px;text-align:center;">
		<form action="${SITE}/greeting" method="post">
			普通请求:
			<input type="text" name="greeting" /><!-- 跟方法参数名一样，Spring会自动绑定 -->
			<input type="submit" value="提交" />
		</form>
		
		<br />
		<br />
		<br />
		
		<form action="${SITE}/ajax.json">
			AJAX请求： <input type="submit" value="提交" />
		</form>
		
		<br />
		<br />
		<br />
		
		<form action="${SITE}/upload.json" method="post" enctype="multipart/form-data">
			文件上传：<input type="file" name="file" /> 
			<input type="submit" value="提交" />
		</form>
	</div>
</body>
</html>